'use strict';

const Service = require('egg').Service;
// const mysql = require('mysql');
// let result = '';

// const connection = mysql.createConnection({
//     host: 'localhost',
//     user: 'root',
//     password: 'root',
//     database: 'equipment'
// });

class equipmentService extends Service {
    async findall() {
        console.log('EquipmentService======>findall()');
        // console.log('mysql'+this.app.mysql);
        // console.log(this.app.config);
        let data = [];
        data = await this.app.mysql.select('e_instrument');
        // await connection.query('SELECT * FROM e_instrument', function (err, results) {
        //     data = results;
        //     return results;
        // });
        console.log(data);
        return data;
        //connection.end();

    }
}

module.exports = equipmentService;